package com.red.wood.module.eval.web;

import net.sf.json.JSONObject;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.red.wood.module.eval.service.TaskFlowService;

@Controller
@RequestMapping("/evalTaskFlow")
public class TaskFlowController {

	private static final Log log = LogFactory.getLog(TaskFlowController.class);
	
	@Autowired
	private TaskFlowService taskFlowService;
	
	
	@RequestMapping(value="getBySingleTaskId", method=RequestMethod.POST)
	@ResponseBody
	public String  getBySingleTaskId(String singleTaskId){
		JSONObject json = new JSONObject();
		try{
			json.put("datas", taskFlowService.getBySingleTaskId(singleTaskId));
			json.put("flag",true);
		}catch(Exception e){
			if(log.isErrorEnabled()){
				log.error(e.getMessage(),e);
			}
			json.put("flag",false);
		}
		return json.toString();
	}
}
